#pragma once
#ifndef LAYOUTBASE_H_
#define LAYOUTBASE_H_

#include "ClientParams.h"
#include "LayoutStructs.h"
#include "LayoutNode.h"
#include "List.h"

namespace fusion
{
    namespace mode10
    {
		class LayoutGroup : public LayoutNode
        {
        public:
			virtual void logMeasureResult() {};
			virtual bool IsLayoutable() const { return true; }
            // params can be Ref type, input params should be...?
            Ref<BaseLayoutParams> GenerateLayoutParams(const Ref<ClientParamsAdapter>& params);
			bool AddLayoutNode(const Ref<LayoutNode> child);
			bool RemoveLayoutNode(Ref<LayoutNode> child);
			void RemoveAllChild();
			static Ref<BaseLayoutParams> GetDefaultParams(const Node* node);
        //protected:
            LayoutGroup(Node* node,  Ref<BaseLayoutParams> params);
            virtual ~LayoutGroup();
        protected:
			virtual void onMeasure(const Ref<MeasureSpec>& widthSpec, const Ref<MeasureSpec>& heightSpec) {};
			virtual void onLayout() {};
            virtual Ref<BaseLayoutParams> onGenerateLayoutParams(const Ref<ClientParamsAdapter>& params);
			virtual bool onAddLayoutNode(const Ref<LayoutNode> child);
			virtual bool onRemoveLayoutNode(Ref<LayoutNode> child);
			List<Ref<LayoutNode> > m_Nodes;
        };
    }
}

#endif /* LAYOUTBASE_H_ */
